import Vue from 'vue'
import Router from 'vue-router'
import homeHeader from '@/components/homeHeader'
import classes from '@/pages/class/class'
import classList from '@/pages/classList/classList.vue'
import classDetail from '@/pages/classDetail/classDetail.vue'
import learning from '@/pages/learning/learning.vue'
import reply from '@/pages/reply/reply.vue'
import personalCenter from '@/pages/personalCenter/personalCenter.vue'
import pcNews from '@/pages/pcNews/pcNews'
import pcClass from '@/pages/pcClass/pcClass'
import pcCertificate from '@/pages/pcCertificate/pcCertificate'
import pcQuestion from '@/pages/pcQuestion/pcQuestion'
import pcMember from '@/pages/pcMember/pcMember'
import setprofile from '@/pages/setprofile/setprofile'
import news from '@/pages/news/news'
import examDetail from '@/pages/examDetail/examDetail'
import newsDetail from '@/pages/newsDetail/newsDetail'
import exam from '@/pages/exam/exam'
import searchResult from '@/pages/searchResult/searchResult'
import myClass from '@/pages/pcClass/myClass'
import editChapter from '@/pages/pcClass/editChapter'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: homeHeader,
      children: [
        {
          path: '',
          name: 'classes',
          component: classes
        },
        {
          path: 'courseList',
          name: 'classList',
          component: classList
        },
        {
          path: 'courseDetail',
          name: 'classDetail',
          component: classDetail,
          // children: [
          //   {
          //     path: 'pcNews',
          //     name: 'pcNews',
          //     component: pcNews
          //   },
          //   {
          //     path: 'pcNews',
          //     name: 'pcNews',
          //     component: pcNews
          //   },
          //   {
          //     path: 'pcNews',
          //     name: 'pcNews',
          //     component: pcNews
          //   },
          // ]
        },
        {
          path: 'learning',
          name: 'learning',
          component: learning
        },
        {
          path: 'reply',
          name: 'reply',
          component: reply
        },
        {
          path: 'news',
          name: 'news',
          component: news
        },
        {
          path: 'newsDetail',
          name: 'newsDetail',
          component: newsDetail
        },
        {
          path: 'exam',
          name: 'exam',
          component: exam
        },
        {
          path: 'examDetail',
          name: 'examDetail',
          component: examDetail
        },
        {
          path: 'personalCenter',
          name: 'personalCenter',
          component: personalCenter,
          children: [
            {
              path: 'pcNews',
              name: 'pcNews',
              component: pcNews
            },
            {
              path: 'pcClass',
              name: 'pcClass',
              component: pcClass
            },
            {
              path: 'pcCertificate',
              name: 'pcCertificate',
              component: pcCertificate
            },
            {
              path: 'pcQuestion',
              name: 'pcQuestion',
              component: pcQuestion
            },
            {
              path: 'pcMember',
              name: 'pcMember',
              component: pcMember
            },
            {
              path: 'pcEmployee',
              name: 'pcEmployee',
              component: pcMember
            },
            {
              path: 'pcTeacher',
              name: 'pcTeacher',
              component: pcMember
            },
            {
              path: 'myClass',
              name: 'myClass',
              component: myClass,
              // children:[
              //   {
              //     path: 'editChapter',
              //     name: 'editChapter',
              //     component: editChapter
              //   }
              // ]
            }
          ]
        },
        {
          path: 'setprofile',
          name: 'setprofile',
          component: setprofile
        },
        {
          path: 'searchResult',
          name: 'searchResult',
          component: searchResult
        },
        {
          path: 'editChapter',
          name: 'editChapter',
          component: editChapter
        }
      ]
    }
  ]
})
